<template>
	<uni-card title="菜单">
		<uni-grid :column="3" :showBorder="false" :square="true" @change="menu">

			
			<uni-grid-item index="8">
				<view class="grid-item-box">
					<uni-icons type="list" size="40"></uni-icons>
					<text class="text">数据排行</text>
				</view>
			</uni-grid-item>
			<uni-grid-item index="9">
				<view class="grid-item-box">
					<uni-icons type="list" size="40"></uni-icons>
					<text class="text">数据对比</text>
				</view>
			</uni-grid-item>
			<uni-grid-item index="10">
				<view class="grid-item-box">
					<uni-icons type="list" size="40"></uni-icons>
					<text class="text">DKP</text>
				</view>
			</uni-grid-item>
			<uni-grid-item index="11">
				<view class="grid-item-box">
					<uni-icons type="cloud-download" size="40"></uni-icons>
					<text class="text">数据下载</text>
				</view>
			</uni-grid-item>
		</uni-grid>

		<uni-popup ref="popup" type="dialog">
			<uni-popup-dialog message="提示" :content="dialogContent" :duration="0" @confirm="dialogConfirm">
			</uni-popup-dialog>
		</uni-popup>
		<uni-popup ref="popupQuit" type="dialog">
			<uni-popup-dialog message="提示" :content="dialogContent" :duration="0" @confirm="dialogConfirmQuit">
			</uni-popup-dialog>
		</uni-popup>
		<uni-popup ref="popupDelete" type="dialog">
			<uni-popup-dialog message="提示" :content="dialogContent" :duration="0" @confirm="dialogConfirmDelete">
			</uni-popup-dialog>
		</uni-popup>
		<!-- 提示信息弹窗 -->
		<uni-popup ref="message" type="message" :value="popupMessage">
			<uni-popup-message :type="popupMessage.msgType" :message="popupMessage.messageText" :duration="1000">
			</uni-popup-message>
		</uni-popup>
	</uni-card>
</template>

<script>
	export default {
		data() {
			return {
				unionId: '',
				role: 0,
				dialogContent: '',
				runningStatus: '',
				popupMessage: {
					type: 'center',
					msgType: 'success',
					messageText: '这是一条成功提示',
					value: ''
				}
			}
		},
		onLoad: function(option) {
			this.unionId = option.unionId
			this.onload()
		},
		methods: {
			menu(e) {
				switch (e.detail.index) {
					case 8:
						uni.navigateTo({
							url: "/pages/statRank/statRank?serverId=" + getApp().globalData.user.serverId
						})
						break
					case 9:
						uni.navigateTo({
							url: "/pages/statCompare/statCompare?serverId=" + getApp().globalData.user.serverId
						})
						break
					case 10:
						uni.navigateTo({
							url: "/pages/statDKP/statDKP?serverId=" + getApp().globalData.user.serverId
						})
						break
					case 11:
						uni.navigateTo({
							url: "/pages/statDownload/statDownload?serverId=" + getApp().globalData.user.serverId
						})
						break
				}
			},
			onload(){
				
			}
		},
		onShareAppMessage: function(options) {
			var that = this;
			var shareObj = {
				path: '/pages/menu/menu'
			};
			return shareObj;
		},
		onPullDownRefresh:function(){
			this.onload()
			uni.stopPullDownRefresh()
		}
	}
</script>

<style>
	.grid-item-box {
		flex: 1;
		position: relative;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 15px 0;
	}

	.grid-dot {
		position: absolute;
		top: 5px;
		right: 15px;
	}

	.container {
		padding: 20 rpx;
	}
</style>
